<?php
namespace app\common\validate;

use think\Validate;

class UserSiteValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'username|用户'       => 'require',
        'password|密码'       => 'require',
        'name|姓名'           => 'require',
        'company_name|公司名称' => 'require',
        'site_name|店铺名称'    => 'require',
        'site_tel|店铺电话'     => 'require',
    ];
    //验证场景
    protected $scene = [
        'add'  => ['username', 'password', 'name', 'company_name', 'site_name', 'site_tel'],
        'edit' => ['username', 'name', 'company_name', 'site_name', 'site_tel'],
        'reg'  => ['username', 'password', 'name', 'company_name', 'site_name', 'site_tel'],
        'site'  => ['name', 'company_name', 'site_name', 'site_tel'],
    ];
}